<extend name="Public/base"/>

<block name="body">
	<!-- 标题栏 -->
	<div class="main-title">
		<h2>策划组业绩统计</h2>

	</div>
    <div class="tools">
            <form action="{:U()}" method="post">
                选择时间：
                <input type="text" value="{$begin}" name="time_start" class="date" style="width:80px;" onclick="laydate()"> - <input type="text" value="{$end}" name="time_end" class="date" style="width:80px;" onclick="laydate()">
				客服工号：
				
				<select name="kf">
						<option value="88888" <eq name="kf" value="88888"> selected </eq> >所有</option>
                        <volist name="kefu" id="vo">
                        <option value="{$vo.uid}" <eq name="vo.uid" value="$kf"> selected</eq>  >{$vo.nickname}</option>
                        </volist>
                </select>
                <span class="buttons">
                    <input type="submit"  id="submit" class="btn" value="开始查询">
                </span>
            </form>
    </div>


    <div id="shuju" style="width: 100%;height:400px;margin-top: 20px;"></div>
	<script type="text/javascript">
        // 基于准备好的dom，初始化echarts实例
        var myChart = echarts.init(document.getElementById('shuju'));

        // 指定图表的配置项和数据
        

        option = {
            title : {
                text: '各渠道建单量统计',
                x:'center'
            },
            tooltip : {
                trigger: 'item',
                formatter: "{a} <br/>{b} : {c} ({d}%)"
            },
            legend: {
                orient: 'vertical',
                left: 'left',
                data: [<foreach  name="_list" item="vo">
                               '{$vo.name}',
                           </foreach>]
            },
            series : [
                {
                    name: '建单来源',
                    type: 'pie',
                    radius : '55%',
                    center: ['50%', '60%'],
                    data:[
                            <foreach  name="_list" item="vo">
                                    {value:<?php echo $vo['jd']; ?>, name:'<?php echo $vo['name']; ?>'},
                            </foreach>
                          ],
                    itemStyle: {
                        emphasis: {
                            shadowBlur: 40,
                            shadowOffsetX: 0,
                            shadowColor: 'rgba(0, 0, 0, 0.5)'
                        }
                    }
                }
            ]
        };


        // 使用刚指定的配置项和数据显示图表。
        myChart.setOption(option);
    </script>

	<!-- 数据列表 -->
	<div class="data-table">
        <div class="data-table table-striped">
<table class="">
    <thead>
        <tr>
		<th >渠道名称</th>
		<th class="">咨询量</th>
		<th class="">获取量</th>
        <th class="">建单量</th>
		<th class="">微信量</th>
        <th class="">手机量</th>
		<th class="">咨询转化率</th>
		</tr>
    </thead>
    <tbody>
	<notempty name="_list">
		<volist name="_list" id="vo">
		<tr>
			<td>{$vo.name}</td>
			<td>{$vo.zixun}</td>
			<td>{$vo.huoqu}</td>
			<td>{$vo.jd}</td>
            <td>{$vo.qq}</td>
            <td>{$vo.phone}</td>
			<td><?php echo number_format($vo['huoqu']/$vo['zixun'],2)*100; ?>%</td>			
		</tr>
		</volist>
		<else/>
		<td colspan="8" class="text-center"> aOh! 暂时还没有内容! </td>
		</notempty>
       <tr>
            <td style="background-color:#51D0CA;">总计</td>
			<td style="background-color:#51D0CA;">{$zj.zixun}</td>
			<td style="background-color:#51D0CA;">{$zj.huoqu}</td>
			<td style="background-color:#51D0CA;">{$zj.jd}</td>
            <td style="background-color:#51D0CA;">{$zj.qq}</td>
            <td style="background-color:#51D0CA;">{$zj.phone}</td>
			<td style="background-color:#51D0CA;"><?php echo number_format($zj['huoqu']/$zj['zixun'],2)*100; ?>%</td>		
        </tr>
	</tbody>
    </table>

        </div>
    </div>
    <div class="page">

    </div>
</block>

<block name="script">
    <script src="__STATIC__/thinkbox/jquery.thinkbox.js"></script>
    
</block>
